#include "print.h"
#include "init.h"
#include "memory.h"
#include "../thread/thread.h"

void threadA(void* arg);
void threadB(void* arg);
void threadC(void* arg);

int main(void)
{
	init_all();

	asm volatile ("sti");
	
	print_hex(thread_create("threadA", 1, threadA, NULL));
	print_hex(thread_create("threadB", 1, threadB, NULL));
	print_hex(thread_create("threadC", 1, threadC, NULL));

	int i = 0;
	while(1)
	{
		print_string("main ");
		/*print_hex(i);
		print_char('\n');
		i++;*/
	/*void* p = malloc_page(PF_KERNEL, 1);
	print_hex(p);
	print_char('\n');
	if (NULL == p)
		while(1);*/
	}
	
	return 0;
}

void threadA(void* arg)
{
	while(1)
	print_string("threadA ");
}

void threadB(void* arg)
{
	while(1)
	print_string("threadB ");
}

void threadC(void* arg)
{
	while(1)
	print_string("threadC ");
}
